<template>
	<view class="enroll-view">
		<view class="center-view">
			<text class="title-text">未审核状态的提示语</text>
			<textarea class="border-view theme-input" v-model="unchecked"/>

			
			<text class="title-text">拒绝状态审核状态的提示语</text>
			<textarea class="border-view theme-input" v-model="checked"/>

			<text class="title-text">审核状态的提示语</text>
			<textarea class="border-view theme-input"  v-model="rejected" />
			
			<button @click="lastStep"  class="long-red-button">上一步</button>
			<button @click="submit"  class="long-green-button">下一步</button>
		</view>
			
	</view>
</template>


<script>
	import datetimePicker from "../../components/basic/datetime-picker";
	export default {
		components : {
			datetimePicker
		},
		onLoad : function(){
			var data;
			var vm = this;
			// 载入题目
			uni.getStorage({
				key : 'newEnrollDraft',
				success :function(res){
					data = res.data;
					vm.enrollData = data;
					if(data.statusTip != null){
						this.unchecked = data.statusTip.unchecked == null ? '' : data.statusTip.unchecked;
						this.checked = data.statusTip.checked == null ? '' : data.statusTip.checked;
						this.rejected = data.statusTip.rejected == null ? '' : data.statusTip.rejected;
					}
				},
				fail : function(){
					uni.navigateTo({
						url : 'newEnrollDesc'
					})
				}
			});
			
		},
		onBackPress(options) { 
			uni.navigateTo({
				url : '../user/main'
			}) 
            return true;  
        },  
		data: function () {
			return {
				enrollData : {},
				unchecked : "当前报名正在审核中...",
				checked : "您的报名已通过.",
				rejected : "您的报名被拒绝."
			}
		},
		methods: {
			lastStep : function(){
				var data = this.enrollData;
				data['statusTip'] = {'unchecked':this.unchecked,'checked':this.checked,'rejected':this.rejected};
				uni.setStorage({
					key : 'newEnrollDraft',
					data : data
				});
				uni.navigateTo({
					url : 'newEnrollItem'
				})
			},
			submit : function(){
				var data = this.enrollData;
				data['statusTip'] = {'unchecked':this.unchecked,'checked':this.checked,'rejected':this.rejected};
				uni.setStorage({
					key : 'newEnrollDraft',
					data : data
				});
				uni.navigateTo({
					url : 'newEnrollPReq'
				})
			}
		}
	}
</script>

<style>
	@import "../../common/zcss.css";
	.row-arrange{
		flex-direction: row;
	}
	.enroll-view{
		width: 100%;
		flex-direction: column;
	}
	
	.new-item-view{
		background-color: aqua;
		margin-bottom: 10upx;
	}
	.border-view{
		border:1upx solid gray;
		width: 90%;
		/* background-color: white; */
	}
	.title-text{
		font-size:40upx;
		color:gray;
	}
</style>
